package Qgjx;

public class Student {
    public String stdname;
    public Laboratory[] lab;
    public double money;


    public Student(String name,Laboratory[] lab,double money) {
        this.stdname = name;
        this.lab = lab;
        this.money = money;
    }

    public double getmoney() {
        return money;
    }

    public double losemoney(double money) {
        this.money -= money;
        return money;
    }

    public double earnmoney(double money) {
        this.money += money;
        return money;
    }

    public Laboratory[] setlaboratory(int N, Laboratory[] lab, Laboratory lab1) {
        this.lab[N] = lab1;
        return lab;
    }

    public Laboratory[] getlaboratory() {
        return lab;
    }

    public void WorkStudyIncome(String[] List1, Student student) {
        try {
            for (int t = 0; t < 18; t++) {
                if (List1[t] == "极好") {
                    student.earnmoney(300);
                }
                if (List1[t] == "好") {
                    student.earnmoney(200);
                }
                if (List1[t] == "不好") {
                    student.earnmoney(0);
                }
                if (List1[t] == "极好" || List1[t] == "好" || List1[t] == "不好") {
                    continue;
                }
            }
        }catch (Exception e) {
            System.out.println("ERROR!");
        }
    }
}